﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace PICOC.Test
{
    [TestClass]
    public class QueryWithSynonymsTest
    {

        [TestMethod]
        public void should_link_the_synonyms_with_OR()
        {
            PICOCElement population = new PICOCElement("Web Authentication", "Authentication System", "Web Access");
            PICOCElement intervention = new PICOCElement("Semantic Web", "Web 3.0");
            PICOCElement context = new PICOCElement("Cloud Computing", "Grid Computing", "Distributed Systems");
            PICOCElement outcome = new PICOCElement("Solutions", "Frameworks");

            PICOCStructure structure = new PICOCStructure(population, intervention, context, outcome);

            String query = structure.CreateQuery();

            Assert.AreEqual("(\"Web Authentication\" OR \"Authentication System\" OR \"Web Access\") AND (\"Semantic Web\" OR \"Web 3.0\") AND (\"Cloud Computing\" OR \"Grid Computing\" OR \"Distributed Systems\") AND (\"Solutions\" OR \"Frameworks\")", query);
        }

    }
}
